import { App } from 'vue'
import LocalIcon from '@/components/LocalIcon/index.vue'

/* 注册本地全局图标 */
/* 使用 <local-icon icon="svg-user" /> */
/* 使用 <def-icon icon="svg-user" /> */
export default {
  install(app: App) {
    const requireComponent = require.context(
      '../../assets/icons/svg',
      false,
      /\.svg$/
    )
    requireComponent.keys().forEach((fullPath) => requireComponent(fullPath))
    app.component('LocalIcon', LocalIcon)
  }
}
